using System;

namespace problem_2
{
    public static class Fibonacci
    {
        public static int Value(int index)
        {
            if (index < 4)
                return index;

            var p1 = 2;
            var p2 = 3;
            var current = 0;
            for (var i = 4; i < (index + 1); i++)
            {
                current = p1 + p2;
                p1 = p2;
                p2 = current;
            }

            return current;
        }
    }
}